package com.acme.bankapp.domain.bank;

public class SavingAccount extends AbstractAccount implements Account {

	public SavingAccount(final double amount) {
		super(amount);
	}

	@Override
	public void deposit(final double amount) {
		setBalance(getBalance() + amount);
	}

	@Override
	public void withdraw(final double amount) {
		double balance = getBalance();
		if (balance >= amount) {
			setBalance(balance - amount);
		}
	}

	@Override
	public double maximumAmountToWithdraw() {
		return getBalance();
	}

	@Override
	public double getOverDraft() {
		return 0;
	}

}
